#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include <sys/types.h>          /*  See NOTES */
#include <sys/socket.h>
#include <libgen.h>
#include <unistd.h>
#include <getopt.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/epoll.h>
#include <sqlite3.h>


#define     BACK_LOG    13
#define     ERROR       -1
#define     MAX_EV      256
#define     OK          1
#define     ERROR       -1


int Accept(int listen_fd)  ;//accept new client
int CreatSocket(char *lis_addr, int port) ;
void analysis_temperinfo(char *buf, char *sn, char *time, char *temper) ;
int Opendb_create_table(char *DB_NAME, sqlite3  **db,char *table_name) ;
void log_roll_back(int log_fd) ;
void Insert_to_sqlite(sqlite3 *db,char *sn, char *time, char *temper) ;

